<extend name="public:base" />

<block name="left">
	<div class="mark_bar cl">
		<a href="{:url('uc/bank/index')}" class="goback fl"><i class="iconfont">&#xe600;</i></a>
		<p>更换银行卡</p>
	</div>
</block>

<block name="main">
	<div class="content">
		<div class="center_link_list">
			<ul>
				<li>
					<a href="javascript:movetop('banklist_info');">
						<span class="small">资金同卡进出，请绑定您的常用卡</span>
						<i class="iconfont arrow_r">&#xe611;</i>
						<i class="fr small">查看银行限额</i>
						<div class="cl"></div>
					</a>
				</li>
			</ul>
		</div>
		<div class="pt1"></div>
		<div class="other_input_bar">
			<p class="small">
				持卡人：
				<if condition="mb_strlen($info['real_name']) eq 3">*{$info.real_name|mb_substr=-2,2,'utf-8'}
					<else/> *{$info.real_name|mb_substr=-1,1,'utf-8'}
				</if>
			</p>
			<p class="small">身份证号：{$info.idcard|substr=0,4}****{$info.idcard|substr=-4,4}</p>
		</div>
		<form action="{:url('uc/bank/replace_bank')}" method="post" id="form">
			<div class="bind_card from">
				<input type="hidden" id="bank_name" name="bank_name" />
				<input type="hidden" id="bank_code" name="bank_code" />
				{:token()}
				<div class="input_form">
					<div class="input_form_bar">
						<p class="fl">开户银行</p>
						<select id="selectBank">
							<volist name="banklist" id="v">
								<option value="{$v.bank_code}">{$v.bank_name}</option>
							</volist>
						</select>
						<div class="cl"></div>
					</div>
					<div class="input_form_bar">
						<p class="fl">银行卡号</p>
						<input type="number" id="card_id" name="card_id" placeholder="请输入储蓄卡卡号" autocomplete="off" />
						<div class="cl"></div>
					</div>
				</div>

				<div class="wrap">
					<button class="submit nor" type="submit">确定</button>
				</div>
			</div>
		</form>

		<div id="banklist_info" class="openframe hide">
			<div class="mark_bar invest_mark_bar">
				<a href="javascript:;" onclick="movebot('banklist_info');" class="goback fl"><i class="iconfont">&#xe602;</i></a>
				<p>查看各支持银行充值限额</p>
			</div>
			<div class="openframe_content">
				<p class="red small">提示：新卡首笔充值2个自然日后为老卡（24小时为一个自然日）</p>
				<ul class="banklist pt05">
					<volist name="banklist" id="v">
						<li>
							<img src="__IMG__/old_banklogo/{$v.bank_code}.png" />
							<p>
								<span class="blue">{$v.bank_name}</span><br />
								<span class="a999 small">{$v.card_limit}</span>
							</p>
							<div class="cl"></div>
						</li>
					</volist>
				</ul>
			</div>
		</div>
	</div>

</block>

<block name="menu"></block>

<block name="js">
	<script type="text/javascript" src="__JS__/check.js?v={:config('app_ver')}"></script>
	<script type="text/javascript">

        //验证提交
        $('#form').submit(function() {
            if(!checkBankcard()) return false;
            return ajax_post($(this),'','',1);
        });

        $("#selectBank").each(function () {
            var selected = $(this).find("option:selected");
            $("#bank_code").val(selected.val());
            $("#bank_name").val(selected.html());
            $(this).change(function () {
                $("#bank_code").val($(this).val());
                $("#bank_name").val($(this).find("option:selected").html());
            });
        })

	</script>
</block>